<?php
$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();

$auth = Zend_Auth::getInstance();
$identity = $auth->getIdentity();

define('THEME', 'default-ui');

$this->headLink()
        //->appendStylesheet('http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:extralight,light,regular,bold')
          //       ->appendStylesheet('http://fonts.googleapis.com/css?family=PT+Serif+Caption')
                 ->appendStylesheet($this->baseUrl('css/reset.css'))
                 ->appendStylesheet($this->baseUrl('css/grid.css'))
                 ->appendStylesheet($this->baseUrl('css/style.css'))
                 ->appendStylesheet($this->baseUrl('css/elfinder.css'))
                 ->appendStylesheet($this->baseUrl('css/jquery.ui.datatables.css'))
                 ->appendStylesheet($this->baseUrl('css/jquery.slidernav.css'))
                 ->appendStylesheet($this->baseUrl('css/jquery.fullcalendar.css'))
                 ->appendStylesheet($this->baseUrl('css/ui/'.THEME.'/ui.css'))
                 ->appendStylesheet($this->baseUrl('css/ui/'.THEME.'/portlet.css'))
                 ->appendStylesheet($this->baseUrl('css/ui/'.THEME.'/jquery.ui.uniform.css'))
                 ->appendStylesheet($this->baseUrl('css/ui/'.THEME.'/colors/jquery.ui.colors.default.css'), array("screen"), NULL, array("class"=>"uicolor"))
                 ->appendStylesheet($this->baseUrl('css/forms.css'))
                 ->appendStylesheet($this->baseUrl('css/prettify.css'))
                 ->appendStylesheet($this->baseUrl('css/ie.css'), "screen", "lt IE 8");

$this->headScript()->appendFile($this->baseUrl('js/html5.js'), "text/javascript", array("conditional" => "lt IE 9"))
                   ->appendFile($this->baseUrl('js/jquery-1.7.2.min.js'))
                   ->appendFile($this->baseUrl('js/jquery.selectors.js'))
                   ->appendFile($this->baseUrl('js/jquery.easing.js'))
                   ->appendFile($this->baseUrl('js/jquery.cookie.js'))
                   ->appendFile($this->baseUrl('js/hoverIntent.js'))
                   ->appendFile($this->baseUrl('js/jquery.tools.min.js'))
                   ->appendFile($this->baseUrl('js/overlay.apple.js'))
                   ->appendFile($this->baseUrl('js/jquery.ui.min.js'))
                   ->appendFile($this->baseUrl('js/jquery.uniform.min.js'))
                   ->appendFile($this->baseUrl('js/jquery.dataTables.min.js'))
                   ->appendFile($this->baseUrl('js/jquery.slidernav.js'))
                   ->appendFile($this->baseUrl('js/jquery.fullcalendar.min.js'))
                   ->appendFile($this->baseUrl('js/jquery.isotope.min.js'))
                   ->appendFile($this->baseUrl('js/superfish.js'))
                   ->appendFile($this->baseUrl('js/supersubs.js'))
                   ->appendFile($this->baseUrl('js/elfinder.full.js'))
                   ->appendFile($this->baseUrl('js/prettify/prettify.js'))
                   ->appendFile($this->baseUrl('js/global.js'))
                   ->appendFile($this->baseUrl('js/selectivizr.js'), "text/javascript", array("conditional" => "lt IE 9"))
                   ->appendFile($this->baseUrl('js/ie.js'), "text/javascript", array("conditional" => "lt IE 8"));
?>
<?php echo $this->doctype() ?>
<html lang="en">
<head>
<?php
echo $this->headMeta();
echo $this->headTitle();
echo $this->headLink();
//echo $this->minCss();
echo $this->headScript();
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
	$(function() {
		var availableTags = [
			"ActionScript",
			"AppleScript",
			"Asp",
			"BASIC",
			"C",
			"C++",
			"Clojure",
			"COBOL",
			"ColdFusion",
			"Erlang",
			"Fortran",
			"Groovy",
			"Haskell",
			"Java",
			"JavaScript",
			"Lisp",
			"Perl",
			"PHP",
			"Python",
			"Ruby",
			"Scala",
			"Scheme"
		];
		$( "#quick-search" ).autocomplete({
			source: availableTags
		});
	});
</script>
<script type="text/javascript">
            $(document).ready(function(){
               $("#lekcje_tab a").click(function(e){
                  e.preventDefault();
                  $("#podlekcja").load("/index/podlekcja/id/"+this.href);
                  $("#historia").load("/index/historia/id/"+this.href);
               });
               $("#lekcje_tab_hist a.podle").live('click',function(e){
                  e.preventDefault();
                  $("#podlekcja").load("/index/podlekcja/id/"+this.href);
               });
               $("a#uwagid").live('click',function(e){
                  e.preventDefault();
                  $("#pod_komentarz").load(this.href);
               });
               
               $("a#zalicz").live('click',function(e){
                  e.preventDefault();
                  $("#pod_komentarz").load(this.href);
               });
               $("#pod_komentarz form").live('submit',function(e){
                  e.preventDefault();
                  $.ajax({
                      type: 'POST',
                      url: '/index/uwagid/',
                      data: 'id='+$("#id")+'uwagi='+$("#uwagi").val(),
                      success: function(m){
                          alert ("Dodano komentarz");
                      }
                  });
                  
               });
               
            });
        </script>
        <script type="text/javascript" src="/js/jquery.swfobject.js"></script>

<!-- LOADING SCRIPT -->
<script>
$(window).load(function(){
    $("#loading").fadeOut(function(){
        $(this).remove();
        $('body').removeAttr('style');
    });
});
</script>

<style type = "text/css">
    #container {position: absolute; top:50%; left:50%;}
    #content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
    #content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
    #loadinggraphic {margin-right: 0.2em; margin-bottom:-2px;}
    #loading {background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0; z-index: 9999;}
</style> 
<!-- LOADING SCRIPT END -->

</head>
<body style="overflow: hidden;">

    <div id="loading"> 
        <script type = "text/javascript"> 
            document.write("<div id='container'><p id='content'>" +
                           "<img id='loadinggraphic' width='16' height='16' src='<?=$this->baseUrl('images/ajax-loader-eeeeee.gif')?>' /> " +
                           "Trwa ładowanie...</p></div>");
        </script> 
    </div> 
    
    <div id="wrapper" class="clearfix">
        <header class="container_8 clearfix">
            <div class="grid_8">
                <h1>Panel zarządzania</h1>
                <nav>
                    <ul class="sf-menu clearfix">
                        <li <?=$controller=='dashboard'? 'class="active"' : ''?>><a href="<?=$this->baseUrl('index')?>">Podsumowanie</a>
                          
                        </li>
                        <li <?=$controller=='admin'? 'class="active"' : ''?>><a href="#">Zarządzanie</a>
                            <ul>
                                <li><a href="<?=$this->baseUrl('index')?>">Pacjenci</a></li>
                                <?if($this->identity->rola=='operator') { ?>
                                    <li><a href="<?=$this->baseUrl('uzytkownik/logopedzi')?>">Logopedzi</a></li>
                                    <li><a href="<?=$this->baseUrl('index/pacjenci')?>">Przypisanie</a></li>
                                    <li><a href="<?=$this->baseUrl('admin/placowki')?>">Placówki</a></li>
                                <? } ?>
                            </ul>
                        </li>
                        
                        <li class="fr"><a href="#" class="arrow-down"><?=$this->identity->imie;?> <?=$this->identity->nazwisko;?></a>
                            <ul>
                                
                                <li><a href="<?=$this->baseUrl('/login/logout')?>">Wyloguj</a></li>
                                <li><a href="<?=$this->baseUrl('/index/haslo')?>">Zmień hasło</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </header>
        
        <section>
            <div class="container_8 clearfix">                

                <!-- Main Section -->

<?php echo $this->layout()->content; ?>

                <!-- Main Section End -->

            </div>
        </section>
    </div>
    
    <footer>
        <div id="footer-inner" class="container_8 clearfix">
            <div class="grid_8">
                <span class="fr"><a href="mailto:kamil@kamilszarmach.pl">Kamil Szarmach</a></span>&copy; 2011-2012. 
            </div>
        </div>
    </footer>

</body>
</html>